package com.example.springboot_code_read.propertiesBeanDefinitionReader;

import com.example.springboot_code_read.bean.MyBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.PathResource;

public class PropertiesBeanDefinitionReaderTest {

    public static void main(String[] args) {

        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();

        PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(beanFactory);

        reader.loadBeanDefinitions(new ClassPathResource("myBean.properties"));

        MyBean myBean = beanFactory.getBean("myBean", MyBean.class);

        System.out.println(myBean);


    }

}
